<?php
include 'all.php';
// Initializations of the variables used
$dates = array();

include '../../include/config.php';
$q = mysql_query("select * from me_personal_agenda where uid='".$_COOKIE['gid']."' ");
while ($row = mysql_fetch_array($q))
{
	// because $row['start_date'] will have this form: 2012-01-10 and in Javascript we have 2012-1-10, 
	// we need to rewrite it the way we use it in Javascript so we can compare it
	$row['start_date'] =  date("Y-n-j", strtotime($row['start_date']));
	$dates[] = $row;
}	

echo json_encode($dates);

?>
